﻿/*****************************************************************************
 * Hyldahl.Services.TaskProcessing.ConsoleHost     Created by: MSH 2008.07.22
 * --------------------------------------------------------------------------
 * FileName: Program.cs
 * --------------------------------------------------------------------------
 * Copyright 2009 Martin Sixhøj Hyldahl
 *****************************************************************************/

using System;

namespace Hyldahl.Services.TaskProcessing.ConsoleHost
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Starting Task Processing");
            Console.WriteLine("Press Enter To Stop");
            Console.WriteLine("---------------------------------------------");
            TaskProcessingController controller = new TaskProcessingController(TaskProcessingApplicationContext.Current);

            controller.Initialize();
            controller.StartWorkers();

            Console.ReadLine();

            Console.WriteLine("Stopping workers");
            controller.StopWorkers();
            controller.Dispose();

            Console.WriteLine("");
            Console.WriteLine("Press Enter To Exit");
            Console.ReadLine();
        }
    }
}
